<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(){
            this.name = name
            this.age = 20
            // this.hobby=function(){
            //     console.log("喜欢篮球")
            // }
        }

        //功能空间原型：
        Person.prototype.hobby = function(){
            console.log('喜欢篮球')
        }
        Person.prototype.fn = function(){
            console.log("fn")
        }
        //原型的固有属性
        console.log(Person.prototype.constructor === Person) //true
        let zhangsan = new Person("张三")
        console.log(zhangsan.constructor === Person)
        console.log(zhangsan.__proto__ === Perosn.prototype) //true
        let lisi = new Person("李四")

        console.log(zhangsan.hobby === lisi.hobby) //true  

        //判断类型
        let str = new String("abd")
        let str = 'abc'
        console.log(str.constructor === String)
    </script>
</body>
</html>